﻿using System;
using System.Data;
using System.Collections.Generic;
using ElingOA6_Admin_DSJCJ.Model;
namespace ElingOA6_Admin_DSJCJ.BLL
{
    /// <summary>
    /// ItemRequisitionApply
    /// </summary>
    public partial class ItemRequisitionApply
    {
        private readonly ElingOA6_Admin_DSJCJ.DAL.ItemRequisitionApply dal = new ElingOA6_Admin_DSJCJ.DAL.ItemRequisitionApply();
        public ItemRequisitionApply()
        { }
        #region  BasicMethod
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(ElingOA6_Admin_DSJCJ.Model.ItemRequisitionApply model, List<Model.ItemRequisitionApplyEntry> ItemRequisitionApplyEntryList)
        {
            dal.Add(model, ItemRequisitionApplyEntryList);
        }

        public void Check(ElingOA6_Admin_DSJCJ.Model.ItemRequisitionApply model, List<Model.ItemRequisitionApplyEntry> ItemRequisitionApplyEntryList, List<Model.Item> ItemList)
        {
            dal.Check(model, ItemRequisitionApplyEntryList, ItemList);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(ElingOA6_Admin_DSJCJ.Model.ItemRequisitionApply model, List<Model.ItemRequisitionApplyEntry> ItemRequisitionApplyEntryList)
        {
            dal.Update(model, ItemRequisitionApplyEntryList);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int FItemRequisitionApplyID)
        {

            return dal.Delete(FItemRequisitionApplyID);
        }
        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool DeleteList(string FItemRequisitionApplyIDlist)
        {
            return dal.DeleteList(FItemRequisitionApplyIDlist);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public ElingOA6_Admin_DSJCJ.Model.ItemRequisitionApply GetModel(int FItemRequisitionApplyID)
        {

            return dal.GetModel(FItemRequisitionApplyID);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<ElingOA6_Admin_DSJCJ.Model.ItemRequisitionApply> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            return DataTableToList(ds.Tables[0]);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<ElingOA6_Admin_DSJCJ.Model.ItemRequisitionApply> DataTableToList(DataTable dt)
        {
            List<ElingOA6_Admin_DSJCJ.Model.ItemRequisitionApply> modelList = new List<ElingOA6_Admin_DSJCJ.Model.ItemRequisitionApply>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                ElingOA6_Admin_DSJCJ.Model.ItemRequisitionApply model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = dal.DataRowToModel(dt.Rows[n]);
                    if (model != null)
                    {
                        modelList.Add(model);
                    }
                }
            }
            return modelList;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllList()
        {
            return GetList("");
        }


        #endregion  BasicMethod
        #region  ExtensionMethod

        #endregion  ExtensionMethod
    }
}

